<!--
 * @Author: 阿芙
 * @Date: 2021-04-17 10:48:09
 * @LastEditTime: 2021-04-22 18:39:17
 * @LastEditors: Please set LastEditors
 * @Description: 
 * @FilePath: /ManageTemplate/template/admin/system/Test/test.html
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>依琳用户管理</title>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<style>

</style>
<body>
   <div id="App">

   </div>
   <button>获取数据</button>
    <div id="Btn">再次获取</div>
</body>

</html>
<script src="/layuiadmin/layui/layui.js"></script>

<script>

layui.config({
    base:""
}).extend({
    Yiling:"/libs/ruoling-request/js/Yiling-Request"
}).use(["table","layer","jquery",'form','Yiling'],function(){
    let table = layui.table;
    let layer = layui.layer;
    let $ = layui.jquery;
    let form = layui.form;
    let request = layui.Yiling.YI_Ajax;

    console.log(request);


    layer.open({
        type: 2,
        area: ["1200px","800px"],
        fix: false,
        //不固定
        maxmin: true,
        shade: 0.3,
        title: "添加",
        content: "/admin/login",
        btn:  ['<i class="fa fa-check">2</i>', '<i class="fa fa-close">取消</i> '],
        // 弹层外区域关闭
        shadeClose: true,
        cancel: function(index) {
            return true;
        },
    });

   let init = null;
    document.querySelector("button").addEventListener("click",function(){
 
         init = new request().SetUrl("/test").Alone().Init(function(data){
            console.log(data)
            const App = document.querySelector("#App");
            App.innerText = data.ErrorMessage

        })


    })

    document.querySelector("#Btn").addEventListener("click",function (){
        console.log(init);
        init.ReqLoading();
    })

})
</script>


